package edu.lnu.ums.entities.security;

import java.io.Serializable;
import java.security.Principal;

public class UserPrincipal implements Principal, Serializable{
	private static final long serialVersionUID = 1L;
	private final String name;
	
	public UserPrincipal(String name){
		this.name=name;
	}
	
	public String getName() {
		return name;
	}
	
	public int hashCode() {
		return name.hashCode();
	}

	public boolean equals(Object o) {
		if (!(o instanceof UserPrincipal)) {
			return false;
		}
		return name.equals(((UserPrincipal) o).name);
	}

	public String toString() {
		return name;
	}
}
